home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / creat1 / htmledit.frm < prev    next >
Text File  |  1999-07-08  |  4KB  |  147 lines

  1. VERSION 5.00
  2. Object = "{3B7C8863-D78F-101B-B9B5-04021C009402}#1.2#0"; "RICHTX32.OCX"
  3. Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "COMDLG32.OCX"
  4. Begin VB.Form Form1 
  5.    Caption         =   "HTML Editor by Daniel"
  6.    ClientHeight    =   5355
  7.    ClientLeft      =   60
  8.    ClientTop       =   345
  9.    ClientWidth     =   8115
  10.    ClipControls    =   0   'False
  11.    ControlBox      =   0   'False
  12.    Icon            =   "htmleditor.frx":0000
  13.    LinkTopic       =   "Form1"
  14.    ScaleHeight     =   5355
  15.    ScaleWidth      =   8115
  16.    StartUpPosition =   2  'CenterScreen
  17.    Begin VB.CommandButton Command5 
  18.       Caption         =   "Minimize"
  19.       Height          =   375
  20.       Left            =   2760
  21.       TabIndex        =   5
  22.       Top             =   4920
  23.       Width           =   975
  24.    End
  25.    Begin MSComDlg.CommonDialog CommonDialog1 
  26.       Left            =   2640
  27.       Top             =   4920
  28.       _ExtentX        =   847
  29.       _ExtentY        =   847
  30.       _Version        =   393216
  31.    End
  32.    Begin VB.CommandButton Command4 
  33.       Caption         =   "Open"
  34.       Height          =   375
  35.       Left            =   3840
  36.       TabIndex        =   4
  37.       Top             =   4920
  38.       Width           =   975
  39.    End
  40.    Begin VB.CommandButton Command3 
  41.       Caption         =   "Save"
  42.       Height          =   375
  43.       Left            =   4920
  44.       TabIndex        =   3
  45.       Top             =   4920
  46.       Width           =   975
  47.    End
  48.    Begin VB.CommandButton Command2 
  49.       Caption         =   "Preview"
  50.       Height          =   375
  51.       Left            =   6000
  52.       TabIndex        =   2
  53.       Top             =   4920
  54.       Width           =   975
  55.    End
  56.    Begin VB.CommandButton Command1 
  57.       Caption         =   "E&xit"
  58.       Height          =   375
  59.       Left            =   7080
  60.       TabIndex        =   1
  61.       Top             =   4920
  62.       Width           =   975
  63.    End
  64.    Begin RichTextLib.RichTextBox RichTextBox1 
  65.       Height          =   4695
  66.       Left            =   120
  67.       TabIndex        =   0
  68.       Top             =   120
  69.       Width           =   7935
  70.       _ExtentX        =   13996
  71.       _ExtentY        =   8281
  72.       _Version        =   393217
  73.       Enabled         =   -1  'True
  74.       ScrollBars      =   2
  75.       TextRTF         =   $"htmleditor.frx":030A
  76.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  77.          Name            =   "Courier New"
  78.          Size            =   12
  79.          Charset         =   0
  80.          Weight          =   400
  81.          Underline       =   0   'False
  82.          Italic          =   0   'False
  83.          Strikethrough   =   0   'False
  84.       EndProperty
  85.    End
  86. End
  87. Attribute VB_Name = "Form1"
  88. Attribute VB_GlobalNameSpace = False
  89. Attribute VB_Creatable = False
  90. Attribute VB_PredeclaredId = True
  91. Attribute VB_Exposed = False
  92. Private Sub Command1_Click()
  93. rep% = MsgBox("Do you want to quit?", vbQuestion + vbYesNo)
  94. If rep% = vbYes Then
  95. End
  96. Else
  97. Exit Sub
  98. End If
  99.  
  100. End Sub
  101.  
  102. Private Sub Command2_Click()
  103. Open App.Path & "\preview.html" For Output As #1
  104. Print #1, RichTextBox1.Text
  105. Close #1
  106. Load frmBrowser
  107. frmBrowser.Show
  108. frmBrowser.brwWebBrowser.Navigate App.Path & "\preview.html"
  109.  
  110. End Sub
  111.  
  112. Private Sub Command3_Click()
  113. CommonDialog1.Filter = "HTML Files (*.html)|*.html|HTM Files (*.htm)|*.htm)"
  114. CommonDialog1.ShowSave
  115. If CommonDialog1.FileName <> "" Then
  116.     Open CommonDialog1.FileName For Output As #1
  117.     Print #1, RichTextBox1.Text
  118.     Close #1
  119. End If
  120.  
  121. End Sub
  122.  
  123. Private Sub Command4_Click()
  124. CommonDialog1.Filter = "HTML Files (*.html)|*.html|HTM Files (*.htm)|*.htm)"
  125. CommonDialog1.ShowOpen
  126. If CommonDialog1.FileName <> "" Then
  127.     Open CommonDialog1.FileName For Input As #1
  128.     Do Until EOF(1)
  129.     Line Input #1, lineoftext$
  130.     alltext$ = alltext$ & lineoftext$
  131.     RichTextBox1.Text = alltext$
  132.     Loop
  133.     Close #1
  134. End If
  135.  
  136. End Sub
  137.  
  138. Private Sub Command5_Click()
  139. Me.WindowState = 1
  140.  
  141. End Sub
  142.  
  143. Private Sub Form_Load()
  144. RichTextBox1.Text = "<HTML>" & vbCrLf & vbCrLf & "<HEAD>" & vbCrLf & "<TITLE>" & "Web Page</TITLE>" & vbCrLf & "</HEAD>" & vbCrLf & vbCrLf & "<BODY>" & vbCrLf & vbCrLf & "</BODY>" & vbCrLf & vbCrLf & "</HTML>"
  145.  
  146. End Sub
  147.